package besta.moon;

import java.io.PrintWriter;
import java.sql.*;

public class MoonLogger {

    public boolean isLogging() {
        return DriverManager.getLogWriter() != null;
    }

    public void println(String msg) {
        PrintWriter log = DriverManager.getLogWriter();
        if (log != null) {
            synchronized (log) {
                log.print("[besta-moon]");
                log.println(msg);
                log.flush();
            }
        }
    }
}
